﻿import QtQuick 2.2

//使用锚布局 anchors

Rectangle{
    width: 300;
    height: 200;

    Rectangle{
        id: rect1;
        anchors.left: parent.left;

        anchors.leftMargin: 20;

        anchors.top: parent.top;

        anchors.topMargin: 20;



        width: 120;
        height: 120;

        gradient: Gradient{

            GradientStop{position: 0.0; color: "#202020"; }

            GradientStop{position: 1.0; color: "#A0A0A0"; }

    }
}


    Rectangle{
        id: rect2;

        width: 50;
        height: 50;

        anchors.left: rect1.right;

        anchors.bottomMargin: 20;

        anchors.top: rect1.top;


        rotation: 90;

        gradient: Gradient{

            GradientStop{position: 0.0; color: Qt.rgba(0.1,0,0, 1)}

            GradientStop{position: 1.0; color: "#FFFFFF"; }
        }
    }
}
